package com.njmaomao.gj.pyot.domain.wechat.wechatapi.refundquery;

import com.njmaomao.gj.pyot.domain.wechat.wechatapi.ApiResp;
import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.Optional;

/**
 * 查询退款出参
 * @author hh 2018-5-10
 */
@XStreamAlias("xml")
public class RefundQueryResp implements ApiResp {

    // 返回状态码 必填[是] SUCCESS/FAIL
    @XStreamAlias("return_code")
    private String returnCode;

    // 返回信息 必填[否] 返回信息，如非空，为错误原因
    @XStreamAlias("return_msg")
    private String returnMsg;

    // 业务结果 必填[是] SUCCESS/FAIL  SUCCESS退款申请接收成功，结果通过退款查询接口查询
    @XStreamAlias("result_code")
    private String resultCode;

    // 错误码 必填[是] 错误码详见第6节
    @XStreamAlias("err_code")
    private String errCode;

    // 错误描述 必填[是] 结果信息描述
    @XStreamAlias("err_code_des")
    private String errCodeDes;

    // 小程序ID 必填[是] 微信分配的小程序ID
    private String appid;

    // 商户号 必填[是] 微信支付分配的商户号
    @XStreamAlias("mch_id")
    private String mchId;

    // 随机字符串 必填[是] 随机字符串，不长于32位
    @XStreamAlias("nonce_str")
    private String nonceStr;

    // 签名 必填[是] 签名，详见签名算法
    private String sign;

    // 订单总退款次数 必填[否] 订单总共已发生的部分退款次数，当请求参数传入offset后有返回
    @XStreamAlias("total_refund_count")
    private int totalRefundCount;

    // 微信订单号 必填[是] 微信订单号
    @XStreamAlias("transaction_id")
    private String transactionId;

    // 商户订单号 必填[是] 商户系统内部订单号，要求32个字符内，只能是数字、大小写字母_-|*@ ，且在同一个商户号下唯一。
    @XStreamAlias("out_trade_no")
    private String outTradeNo;

    // 订单金额 必填[是] 订单总金额，单位为分，只能为整数，详见支付金额
    @XStreamAlias("total_fee")
    private int totalFee;

    // 应结订单金额 必填[否] 当订单使用了免充值型优惠券后返回该参数，应结订单金额=订单金额-免充值优惠券金额。
    @XStreamAlias("settlement_total_fee")
    private int settlementTotalFee ;

    // 货币种类 必填[否] 订单金额货币类型，符合ISO 4217标准的三位字母代码，默认人民币：CNY，其他值列表详见货币类型
    @XStreamAlias("fee_type")
    private String feeType;

    // 现金支付金额 必填[是] 现金支付金额，单位为分，只能为整数，详见支付金额
    @XStreamAlias("cash_fee")
    private int cashFee;

    // 现金支付货币类型 必填[否 ] 货币类型，符合ISO 4217标准的三位字母代码，默认人民币：CNY，其他值列表详见货币类型
    @XStreamAlias("cash_fee_type")
    private String  cashFeeType ;

    // 退款笔数 必填[是] 当前返回退款笔数
    @XStreamAlias("refund_count")
    private int refundCount;

    // 商户退款单号 必填[是] 商户系统内部的退款单号，商户系统内部唯一，只能是数字、大小写字母_-|*@ ，同一退款单号多次请求只退一笔。
    @XStreamAlias("out_refund_no_0")
    private String outRefundNo;

    // 微信退款单号 必填[是] 微信退款单号
    @XStreamAlias("refund_id_0")
    private String refundId;

    /**
     * 退款渠道 必填[否] ORIGINAL—原路退款
     * BALANCE—退回到余额
     * OTHER_BALANCE—原账户异常退到其他余额账户
     * OTHER_BANKCARD—原银行卡异常退到其他银行卡
     */
    @XStreamAlias("refund_channel_0")
    private String refundChannel;

    // 申请退款金额 必填[是] 退款总金额,单位为分,可以做部分退款
    @XStreamAlias("refund_fee_0")
    private int refundFee;

    // 退款金额 必填[否] 退款金额=申请退款金额-非充值代金券退款金额，退款金额<=申请退款金额
    @XStreamAlias("settlement_refund_fee_0")
    private int settlementRefundFee;

    // 代金券类型 必填[否 ] CASH--充值代金券 NO_CASH---非充值优惠券 开通免充值券功能，并且订单使用了优惠券后有返回（取值：CASH、NO_CASH）。$n为下标,$m为下标,从0开始编号，举例：coupon_type_$0_$1
    @XStreamAlias("coupon_type_0_0")
    private String couponType ;

    // 总代金券退款金额 必填[否] 代金券退款金额<=退款金额，退款金额-代金券或立减优惠退款金额为现金，说明详见代金券或立减优惠
    @XStreamAlias("coupon_refund_fee_0")
    private int couponRefundFeeTotal;

    // 退款代金券使用数量 必填[否] 退款代金券使用数量 ,$n为下标,从0开始编号
    @XStreamAlias("coupon_refund_count_0")
    private int couponRefundCount;

    // 退款代金券ID 必填[否] 退款代金券ID, $n为下标，$m为下标，从0开始编号
    @XStreamAlias("coupon_refund_id_0_0")
    private String	 couponRefundId;

    // 单个代金券退款金额 必填[否] 单个退款代金券支付金额, $n为下标，$m为下标，从0开始编号
    @XStreamAlias("coupon_refund_fee_0_0")
    private int couponRefundFee;

    /**
     * 退款状态 必填[是] 退款状态：
     * SUCCESS—退款成功
     * REFUNDCLOSE—退款关闭。
     * PROCESSING—退款处理中
     * CHANGE—退款异常，退款到银行发现用户的卡作废或者冻结了，导致原路退款银行卡失败，可前往商户平台（pay.weixin.qq.com）-交易中心，手动处理此笔退款。$n为下标，从0开始编号。
     */
    @XStreamAlias("refund_status_0")
    private String refundStatus;

    // 退款资金来源 必填[否] REFUND_SOURCE_RECHARGE_FUNDS---可用余额退款/基本账户 REFUND_SOURCE_UNSETTLED_FUNDS---未结算资金退款 $n为下标，从0开始编号。
    @XStreamAlias("refund_account_0")
    private String refundAccount;

    /**
     * 取当前退款单的退款入账方
     * 1）退回银行卡：
     *
     * {银行名称}{卡类型}{卡尾号}
     *
     * 2）退回支付用户零钱:
     *
     * 支付用户零钱
     *
     * 3）退还商户:
     *
     * 商户基本账户
     *
     * 商户结算银行账户
     *
     * 4）退回支付用户零钱通:
     *
     * 支付用户零钱通
     */
    @XStreamAlias("refund_recv_accout_0")
    private String refundRecvAccout;

    // 退款成功时间 必填[否] 退款成功时间，当退款状态为退款成功时有返回。$n为下标，从0开始编号。
    @XStreamAlias("refund_success_time_0")
    private String refundSuccessTime;

    @Override
    public String getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    @Override
    public Optional<String> getReturnMsg() {
        return Optional.ofNullable(returnMsg);
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }

    @Override
    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    @Override
    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    @Override
    public String getErrCodeDes() {
        return errCodeDes;
    }

    public void setErrCodeDes(String errCodeDes) {
        this.errCodeDes = errCodeDes;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public int getTotalRefundCount() {
        return totalRefundCount;
    }

    public void setTotalRefundCount(int totalRefundCount) {
        this.totalRefundCount = totalRefundCount;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public int getTotalFee() {
        return totalFee;
    }

    public void setTotalFee(int totalFee) {
        this.totalFee = totalFee;
    }

    public int getSettlementTotalFee() {
        return settlementTotalFee;
    }

    public void setSettlementTotalFee(int settlementTotalFee) {
        this.settlementTotalFee = settlementTotalFee;
    }

    public String getFeeType() {
        return feeType;
    }

    public void setFeeType(String feeType) {
        this.feeType = feeType;
    }

    public int getCashFee() {
        return cashFee;
    }

    public void setCashFee(int cashFee) {
        this.cashFee = cashFee;
    }

    public String getCashFeeType() {
        return cashFeeType;
    }

    public void setCashFeeType(String cashFeeType) {
        this.cashFeeType = cashFeeType;
    }

    public int getRefundCount() {
        return refundCount;
    }

    public void setRefundCount(int refundCount) {
        this.refundCount = refundCount;
    }

    public String getOutRefundNo() {
        return outRefundNo;
    }

    public void setOutRefundNo(String outRefundNo) {
        this.outRefundNo = outRefundNo;
    }

    public String getRefundId() {
        return refundId;
    }

    public void setRefundId(String refundId) {
        this.refundId = refundId;
    }

    public String getRefundChannel() {
        return refundChannel;
    }

    public void setRefundChannel(String refundChannel) {
        this.refundChannel = refundChannel;
    }

    public int getRefundFee() {
        return refundFee;
    }

    public void setRefundFee(int refundFee) {
        this.refundFee = refundFee;
    }

    public int getSettlementRefundFee() {
        return settlementRefundFee;
    }

    public void setSettlementRefundFee(int settlementRefundFee) {
        this.settlementRefundFee = settlementRefundFee;
    }

    public String getCouponType() {
        return couponType;
    }

    public void setCouponType(String couponType) {
        this.couponType = couponType;
    }

    public int getCouponRefundFeeTotal() {
        return couponRefundFeeTotal;
    }

    public void setCouponRefundFeeTotal(int couponRefundFeeTotal) {
        this.couponRefundFeeTotal = couponRefundFeeTotal;
    }

    public int getCouponRefundCount() {
        return couponRefundCount;
    }

    public void setCouponRefundCount(int couponRefundCount) {
        this.couponRefundCount = couponRefundCount;
    }

    public String getCouponRefundId() {
        return couponRefundId;
    }

    public void setCouponRefundId(String couponRefundId) {
        this.couponRefundId = couponRefundId;
    }

    public int getCouponRefundFee() {
        return couponRefundFee;
    }

    public void setCouponRefundFee(int couponRefundFee) {
        this.couponRefundFee = couponRefundFee;
    }

    public String getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(String refundStatus) {
        this.refundStatus = refundStatus;
    }

    public String getRefundAccount() {
        return refundAccount;
    }

    public void setRefundAccount(String refundAccount) {
        this.refundAccount = refundAccount;
    }

    public String getRefundRecvAccout() {
        return refundRecvAccout;
    }

    public void setRefundRecvAccout(String refundRecvAccout) {
        this.refundRecvAccout = refundRecvAccout;
    }

    public String getRefundSuccessTime() {
        return refundSuccessTime;
    }

    public void setRefundSuccessTime(String refundSuccessTime) {
        this.refundSuccessTime = refundSuccessTime;
    }
}
